//
//  VideoViewController.m
//  WhoElse
//
//  Created by 孙宇鹏 on 15/11/17.
//  Copyright © 2015年 sunsystem. All rights reserved.
//

#import "VideoViewController.h"

@interface VideoViewController ()<UIWebViewDelegate>

@property(nonatomic,strong)UIWebView *videoV;

@end

@implementation VideoViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.videoV.scalesPageToFit = YES;
    
    self.videoV = [[UIWebView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
    
    [self.view addSubview:self.videoV];
    
    self.videoV.delegate = self;
    
//    NSString * string = [NSString stringWithFormat:@"http://dnf.zhangyoubao.com/mobiles/item/%@?dw=320&i_=16660801b2a786dc2f057ffa2aac291f&t_=1447750408&p_=3569&v_=3040702&d_=ios&dv_=9.1",self.id];
//    
//    NSURL * url = [NSURL URLWithString:string];
//    NSURLRequest * request = [NSURLRequest requestWithURL:url];
//    [self.webView loadRequest:request];
    
    NSURL *url = [NSURL URLWithString:@"http://api.m.sm.cn/rest?method=Pcgame.mid&q=%E8%8B%B1%E9%9B%84%E8%81%94%E7%9B%9F%E8%A7%86%E9%A2%91&format=html&key_entity=%E6%B8%B8%E6%88%8F-%E8%8B%B1%E9%9B%84%E8%81%94%E7%9B%9F"];
    
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    
    [self.videoV loadRequest:request];
}

-(void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error{
    
    
}

-(void)webViewDidStartLoad:(UIWebView *)webView{

}

-(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{
    
    return YES;
}

-(void)webViewDidFinishLoad:(UIWebView *)webView{
    
    
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
